package com.ruoyi.tmsreceive.service.impl;

import com.ruoyi.tmsreceive.entity.Waybill;
import com.ruoyi.tmsreceive.mapper.CustomerCheckMapper;
import com.ruoyi.tmsreceive.service.CustomerCheckService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author: 邱兆颖  <br/>
 * Date: 2022/4/20-14:19  <br/>
 * Description:
 */
@Service
public class CustomerCheckServiceImpl implements CustomerCheckService {
    @Resource
    private CustomerCheckMapper customerCheckMapper;

    @Override
    public List<Waybill> selectWaybillList(Waybill waybill) {
        return customerCheckMapper.selectWaybillList(waybill);
    }

    @Override
    public Waybill selectWaybillByWaybillId(Long waybillId) {
        return customerCheckMapper.selectWaybillByWaybillId(waybillId);
    }

    /**
     * 修改货运单
     *
     * @param waybill 货运单
     * @return 结果
     */
    @Override
    public int updateWaybill(Waybill waybill)
    {
        if (waybill.getWaybillStatus() == 3) {
            waybill.setWaybillId((long) 6);
        }else if (waybill.getWaybillStatus() == 4) {
            waybill.setWaybillId((long) 5);
        };
        return customerCheckMapper.updateWaybill(waybill);
    }
}
